import React, {Component} from 'react';


class Modal extends Component {
    constructor(props) {
        super(props);
        this.state = {
            isShow: 'none'
        }
    }


    render() {

        let style = {
            display: this.state.isShow
        }

        return (
            <div>
                <h1>
                    Hello，{this.props.name}!
                </h1>
                <h2 style={style}>我一开始是隐藏的</h2>
            </div>
        );
    }

    show() {
        this.setState({
            isShow: 'block'
        })
        console.log('I am be Called show');
    }
}

export default Modal;